#ifndef GAMESTATE_HPP_
#define GAMESTATE_HPP_
#include <OIS/OISKeyboard.h>
#include <OIS/OISMouse.h>

class GameStateManager;

/*

A GameState is where everything for a scene/menu/whatever is handled.

A state that is active means it should likely be drawn.
A paused state can indicate that game logic should be paused but that whatever is currently onscreen
should still be drawn.
An inactive state should be removed from the state stack and not be drawn anymore.

The drawing of a state is handled indirectly by modifying the scene manager.

*/
class GameState
{
	public:
		GameState() : m_IsActive(false), m_IsInitialized(false) {}
		~GameState() {}

		virtual void Init() = 0;
		virtual void Run(double) = 0;
		virtual void Pause() = 0;
		virtual void Resume() = 0;
		virtual void Exit() = 0;

		//true if this state is on the list of active states, paused or not paused does not matter
		bool IsActive() { return m_IsActive; }
		void SetActive(bool value) { m_IsActive = value; }
		bool IsInitialized() { return m_IsInitialized; }
		void SetInitialized(bool value) { m_IsInitialized = value; }

		virtual bool keyPressed(const OIS::KeyEvent &keyEventRef) = 0;
		virtual bool keyReleased(const OIS::KeyEvent &keyEventRef) = 0;

		virtual bool mouseMoved(const OIS::MouseEvent &evt) = 0;
		virtual bool mousePressed(const OIS::MouseEvent &evt, OIS::MouseButtonID id) = 0;
		virtual bool mouseReleased(const OIS::MouseEvent &evt, OIS::MouseButtonID id) = 0;

		void ChangeState(int);
	protected:
		friend class GameStateManager;
		void SetManager(GameStateManager* manager) { m_Manager = manager; }
		
		

		bool m_IsActive;
		bool m_IsInitialized;
		GameStateManager* m_Manager;

};

#endif /* GAMESTATE_HPP_ */
